package sk.custom.main;

import sk.custom.button.CButton;
import sk.custom.font.CFont;
import sk.custom.frame.CFrame;

import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Color;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Panel;
import java.awt.event.MouseEvent;

import javax.swing.BoxLayout;

public class TestApp extends CFrame {

	/**
	 * @param args
	 */
	public TestApp(){
		super("Test custom button");
		setSize(600, 160);
	}
	public static void main(String[] args) {
		
       TestApp ta = new TestApp(); 
	   ta.setVisible(true);
	   ta.setLayout(new BoxLayout(ta, BoxLayout.X_AXIS));
	   System.out.println("Frame width: " + ta.getWidth() + " frame height: " + ta.getHeight());	   
       Panel p = new Panel();
       System.out.println("Panel p width: " + p.getWidth() + " panel p height: " + p.getHeight());
       Panel b = new Panel();
       System.out.println("Panel b width: " + b.getWidth() + " panel b height: " + b.getHeight());
//       p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
       p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
//       p.setLayout(new BorderLayout());
       
	   CButton cb = new CButton("Ok", CFont.FORTE){
		     @Override
			 public void onClick(MouseEvent e) {
			 }
	   };
	   CButton cb2 = new CButton("Cancel",CFont.FORTE){
		     @Override
			 public void onClick(MouseEvent e) {
			 }		   
	   };
	   CButton cb3 = new CButton("Destroy world", new Font(CFont.JOKERMAN,Font.PLAIN, 22)){
		     @Override
			 public void onClick(MouseEvent e) {
			 }		   
	   };
//	   p.add(cb, BorderLayout.LINE_START);
//	   p.add(cb2, BorderLayout.CENTER);
//	   p.add(cb3, BorderLayout.LINE_END);
	   p.add(cb);
	   p.add(cb2);
	   p.add(cb3);
	   ta.add(b);
	   ta.add(p);
	}
}
